package com.x.pojo;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Past;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.util.Date;

/**
 * ClassName: USER
 * Package: IntelliJ IDEA
 * Description:
 * Written by HanXu
 * Create 2024.09.14 2:25
 */
@Data
public class User {
    @NotBlank //字符串不为空
    private String name;

    @Length(min = 8) //最小长度为8
    private String password;

    @Min(1) //最小为1
    private int age;

    @Email //必须为email格式
    private String email;

    @Past //必须为过去时间
    private Date birth;
}
